#include<bits/stdc++.h>

using namespace std;

int main() {
    int a[4] = {3, 5, 8, 11}, b[7] = {2, 6, 8, 9, 11, 15, 20}, c[11], i, j, k;
    i = j = k = 0;
    while (i < 4 && j < 7) {
        if (a[i] <= b[j])c[k++] = a[i++];
        else c[k++] = b[j++];
    }
    while (i < 4)c[k++] = a[i++];
    while (j < 7)c[k++] = b[j++];
    for (int x = 0; x < k; x++)cout << c[x] << " ";
    cout << endl;
    return 0;
}